import request from '@/utils/request'

export function login(data) {
  return request({

    url: '/auth/local',
    method: 'post',
    data
  })
}

export function getInfo(token) {
  return request({
    url: '/vue-admin-template/user/info',
    method: 'get',
    params: { token }
  })
}
// 获取用户信息
export function UserInformation() {
  return request({
    url: '/users/me',
    method: 'get'
  })
}

// 注册
export function registered(data) {
  return request({
    url: '/auth/local/register',
    method: 'post',
    data
  })
}
// 获取用户权限
export function getPermission() {
  return request({
    url: '/mypermissions'
  })
}

export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}
